]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
iconGrid: Allocate preferred sizes if bigger than child size
authorGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>
Wed, 21 Oct 2020 18:40:20 +0000 (15:40 -0300)
committerGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>
Wed, 21 Oct 2020 21:54:56 +0000 (18:54 -0300)
IconGridLayout uses the biggest minimum size to allocate its
children. Next commit will make app icons with long names show
not ellipsize on hover, and it is important that the icon itself
is able to follow that.

Use preferred size if it's bigger than the minimum size.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1477

js/ui/iconGrid.js

index d778988221d9a3523542859f07b05f3cc5772be3..bc59b1bb08ae7ba541dec0f0617471ce48093c62 100644 (file)
@@ -765,7 +765,6 @@ var IconGridLayout = GObject.registerClass({
             this._calculateSpacing(childSize);
 
         const childBox = new Clutter.ActorBox();
-        childBox.set_size(childSize, childSize);
 
         let nChangedIcons = 0;
 
@@ -802,6 +801,11 @@ var IconGridLayout = GObject.registerClass({
 
                 childBox.set_origin(x, y);
 
+                const [,, naturalWidth, naturalHeight] = item.get_preferred_size();
+                childBox.set_size(
+                    Math.max(childSize, naturalWidth),
+                    Math.max(childSize, naturalHeight));
+
                 // Only ease icons when the page size didn't change
                 if (this._pageSizeChanged)
                     item.allocate(childBox);